home *** CD-ROM | disk | FTP | other *** search
/ Sunrise Express Series 285 / Sunrise Express Series 285.iso / pc / JR.Dxr / 00003_SpriteRotateLib.ls < prev    next >
Encoding:
Text File  |  1998-05-11  |  2.0 KB  |  75 lines

  1. on rotatesprite thesprite
  2.   set existlist to []
  3.   set maxsprite to getmaxlistsprite()
  4.   set minsprite to getminlistsprite()
  5.   set topsprite to 1
  6.   set backsprite to 120
  7.   repeat with n = minsprite to maxsprite
  8.     if the memberNum of sprite n <> 0 then
  9.       set topsprite to max(n, topsprite)
  10.       set backsprite to min(n, backsprite)
  11.       add(existlist, n)
  12.     end if
  13.   end repeat
  14.   if topsprite > thesprite then
  15.     set countnum to count(existlist)
  16.     set startpos to getPos(existlist, thesprite)
  17.     set endpos to countnum
  18.     set m to getAt(existlist, startpos)
  19.     set sx0 to the locH of sprite m
  20.     set sy0 to the locV of sprite m
  21.     set themember to the memberNum of sprite m
  22.     repeat with n = startpos to endpos - 1
  23.       set m0 to getAt(existlist, n + 1)
  24.       set memberNum to the memberNum of sprite m0
  25.       set sx to the locH of sprite m0
  26.       set sy to the locV of sprite m0
  27.       set m1 to getAt(existlist, n)
  28.       set the memberNum of sprite m1 to memberNum
  29.       set the locH of sprite m1 to sx
  30.       set the locV of sprite m1 to sy
  31.     end repeat
  32.     set m to getAt(existlist, countnum)
  33.     set the memberNum of sprite m to themember
  34.     set the locH of sprite m to sx0
  35.     set the locV of sprite m to sy0
  36.     updateStage()
  37.   end if
  38. end
  39.  
  40. on getmaxlistsprite
  41.   global grotatesprite
  42.   set thelist to grotatesprite
  43.   set result to 120
  44.   if count(thelist) > 0 then
  45.     set result to getProp(thelist, #max)
  46.   end if
  47.   return result
  48. end
  49.  
  50. on getminlistsprite
  51.   global grotatesprite
  52.   set thelist to grotatesprite
  53.   set result to 1
  54.   if count(thelist) > 0 then
  55.     set result to getProp(thelist, #min)
  56.   end if
  57.   return result
  58. end
  59.  
  60. on puppetspriteon
  61.   set minsprite to getminlistsprite()
  62.   set maxsprite to getmaxlistsprite()
  63.   repeat with n = minsprite to maxsprite
  64.     set the puppet of sprite n to 1
  65.   end repeat
  66. end
  67.  
  68. on puppetspriteoff
  69.   set minsprite to getminlistsprite()
  70.   set maxsprite to getmaxlistsprite()
  71.   repeat with n = minsprite to maxsprite
  72.     set the puppet of sprite n to 0
  73.   end repeat
  74. end
  75.